﻿@{
    ViewBag.Title="IPhone Customization: overview";
    }
@{
    Layout = "~/Views/Shared/_LayoutIphone.cshtml";
}
<style>
    #wrapper_pop {
        visibility: hidden;
    }

</style>
<div class="top-header">
<div class="right_close">
                        <a href="http://www.home-wizard.com/sponsor-dashboard.aspx">
                            <img src="images/right_close.png" alt=""></a></div></div>
<div class="tab_content">
    <div class="left-shadow"></div>
    <div class="right-shadow"></div>
                        <div class="webwidget_tab" id="webwidget_tab">
<div id="tabs">
    <ul>
        <li><a id="atabs-overview" href="#tabs-overview">Overview</a></li>
        <li><a id="atabs-welcome" href="#tabs-welcome">Welcome screen</a></li>
        <li><a id="atabs-adminlink" href="#tabs-adminlink">Admin link</a></li>
        <li><a id="atabs-myscreen" href="#tabs-myscreen">My screen</a></li>
        <li><a id="atabs-banner" href="#tabs-banner">Banner message</a></li>
        <li><a id="atabs-setup" href="#tabs-setup">Special Features screen</a></li>
      
        <li><a id="atabs-location" href="#tabs-location">Default location</a></li>
      @*  <li><a href="#tabs-promo">promo code</a></li>*@
   
    </ul>
    <div id="tabs-overview">
        @{Html.RenderPartial("Customoverview");}
    </div>
    <div id="tabs-welcome">
        @{Html.RenderPartial("Customwelcome");}
    </div>
    <div id="tabs-adminlink">
        @{Html.RenderPartial("Customadmin");}
    </div>
    <div id="tabs-myscreen">
        @{Html.RenderPartial("Custommyscreen");}
    </div>
    <div id="tabs-banner">
        @{Html.RenderPartial("Custombanner");}
    </div>
    <div id="tabs-setup">
        @{Html.RenderPartial("Customsetup");}
    </div>
   
    <div id="tabs-location">
        @{Html.RenderPartial("Customlocation");}
    </div>
    @*<div id="tabs-promo">
        @{Html.RenderPartial("Custompromocode");}
    </div>*@
</div>
                            </div>
    </div>

<div class="btm-footer"></div>

@section scriptIphone
{
  
<script type="text/javascript">

    function success(result) {
       
         $("#spnMessage").html(result.success);
    }
    function successbanner(result) {
         $("#spnMessagebanner").html(result.success);
     }
    function successwelcome(result) {
       
        $("#spnMessagewelcome").html(result.success);
       
    }
    function successmyscreen(result) {
        $("#spnMessagemyscreen").html(result.success);
        
    }

    function successlocation(result) {
        $("#spnMessagelocation").html(result.success);

    }
    function successpromocode(result) {
        $("#spnMessagepromocode").html(result.success);

    }
    function successsetup(result) {
        $("#spnMessagesetup").html(result.success);

    }

    

    $("#Country").live("change", function (e) {
   
       
        var selectedItem = $(this).val();
        $("#ipscountry").val(selectedItem);
        $("#ipsstateprovince").val("");
        var ddlStates = $("#State");
               
                $.ajax({
                    cache: false,
                    type: "GET",
                    url: "@(Url.Action("getStatesbyCountry", "Iphone"))",
                    data: { "country": selectedItem},
                    success: function (data) {
                        ddlStates.html('');

                        if (selectedItem == "US")
                        {
                            ddlStates.append($('<option></option>').val("").html("-Select state or region-"));
                        }
                        else if (selectedItem == "CAN")
                        {
                            ddlStates.append($('<option></option>').val("").html("-Select Province-"));
                        }


                        $.each(data, function(id, option) {
                            ddlStates.append($('<option></option>').val(option.id).html(option.name));
                        });

                    },
                    error:function (xhr, ajaxOptions, thrownError){
                        alert('Failed to retrieve states.');

                    }  
                });
    });


    $("#State").live("change", function (e) {
        $("#ipsstateprovince").val($(this).val());
    });

    $("#btnSubmitlocation").live("click", function (e) {
        
        if ($("#Country").val() == "")
        {
            alert("You must select a country.");
            return false;
        }
        
        if (($("#State option:selected").val() == "") && ($("#Country option:selected").val() == "US"))
        {
            
            alert("You must select a state or region.");
            return false;
        }
        if (($("#State option:selected").val() == "") && ($("#Country option:selected").val() == "CAN"))
        {
            alert("You must select a province.");
            return false;
        }

    });
    
    //$(function() {
    //    var chkTab = $.cookie("Tabs");
    //    if (chkTab != null) {
    //        $('#tabs').tabs("option", "active", chkTab);
    //    }
    //    else
    //    {
    //        $('#tabs').tabs("option", "active", 0);
    //    }
    //});

    $("#atabs-overview").live('click', function () {
     
        document.title = 'IPhone Customization: Overview';
       
    });
    $("#atabs-welcome").live('click', function () {
        
        document.title = 'IPhone Customization: Welcome Screen';
        //$("#tabs-welcome").html('');
        $("#tabs-welcome").load('/Iphone/Welcom', function (html) { });
    });
    $("#atabs-adminlink").live('click', function () {
       
        document.title = 'IPhone Customization: Admin Link';
       // $("#tabs-adminlink").html('');
        $("#tabs-adminlink").load('/Iphone/Customadmin', function (html) { });
        
    });
    $("#atabs-myscreen").live('click', function () {
       
        document.title = 'IPhone Customization: My Screen';
        //$("#tabs-myscreen").html('');
        $("#tabs-myscreen").load('/Iphone/Custommyscreen', function (html) { });
    });
    $("#atabs-banner").live('click', function () {
       
        document.title = 'IPhone Customization: Banner Message';
        //$("#tabs-banner").html('');
        $("#tabs-banner").load('/Iphone/banner', function (html) { });
    });
    $("#atabs-setup").live('click', function () {
    
        document.title = 'IPhone Customization: Setup done Screen';
        //$("#tabs-setup").html('');
        $("#tabs-setup").load('/Iphone/Customsetup', function (html) { });
    });
    $("#atabs-location").live('click', function () {
        
        document.title = 'IPhone Customization: Default loaction';
      //  $("#tabs-location").html('');
       // $("#tabs-location").load('/Iphone/Customlocation', function (html) { });
    });
     </script>
    <script>
        $(document).ready(function () {
            $(window).load(function () {
                $("#wrapper_pop").css('visibility', 'visible');
               
            });
        });
</script>
  }

   
    


